{# —— Umami 统计(Cloud 版)—— #}

H2P3

 

题目

  1. For any positive integers n and k, define f(n,k) as follows. For each way of writing n as an ordered sum of exactly k nonnegative integers, let S be the product of those k integers. Then f(n,k) is the sum of all of the S’s that are obtained in this way. Find a suitable generating function of f(n,k), and find the numbers themselves.
  2. Let f(n,k,c) be the number of ways to write n as an ordered sum of exactly k integers, each of which is at least c. Find a suitable generating function of f(n,k,c), and find the numbers themselves.

解答

1

solution 1

依据有序和中的第一个数分类,考虑如果出现 0,则乘积为 0

f(n,k)={ 0, kn+1 n, k=1m=1nmf(nm,k1), otherwise

f(n,k) 的生成函数为 F(k,x)=n=0f(n,k)xn

F(1,x)=n=0nxn=x(1x)2

k2

f(n,k)xn=(m=1nmf(nm,k1))xn=m=1nmf(nm,k1)xnF(k,x)=n=0f(n,k)xn=n=0m=1nmf(nm,k1)xnmxm==m=1mxmn=mf(nm,k1)xnm==m=1mxmF(k1,x)=x(1x)2F(k1,x)=(x(1x)2)k=xk(1x)2k

其中

1(1x)2k=n=0(n+2k12k1)xn

f(n,k)=[xn]F(k,x)=(n+k12k1)

solution 2

F(k,x) 写为 k 个生成函数 Fi(x) 之积,Fi(x) 对应有序和中第 i 个数

Fi(x)=n=1nxn=x(1x)2F(k,x)=i=1kFi(x)=(x(1x)2)k=xk(1x)2k

solution 3

f(n,k) 的生成函数为

E(x,z)=k=0n=0f(n,k)k!xnzk

E(x,z) 写为无穷个生成函数 Ei(x,z) 之积,Ei(x,z) 对应有序和中 i 的个数

Ei(x,z)=k=0ikk!xkizk=k=0(ixiz)kk!=eixizE(x,z)=i=1Ei(x)=i=1eixiz=ei=1ixiz=exz(1x)2=k=0zkk!xk(1x)2kf(n,k)=k![xnzk]E(x,z)=k!1k![xn]xk(1x)2k=(n+k12k1)

2

沿用第一问 solution 2 的思路:

f(n,k,c) 的生成函数为 G(k,c,x)=n=0f(n,k,c)xn

G(k,c,x) 写为 k 个生成函数 Gi(x) 之积,Gi(x) 对应有序和中第 i 个数

Gi(x)=n=cxc=xc1xG(k,c,x)=i=1kGi(x)=xck(1x)kf(n,k,c)=[xn]G(k,c,x)=(nck+k1k1)